package com.yang.service;

import com.yang.entity.Address;
import com.yang.dao.AddressDao;

import java.util.*;

public class AddressService {
    private final AddressDao addressDao = new AddressDao();

    //查询全部
    public List<Address> queryAddress() {
        return addressDao.queryAddress();
    }

    //单个查询
    public Address queryAddressById(Integer id) {
        return addressDao.queryAddressById(id);
    }

    //添加
    public int saveAddress(Address obj) {
        return addressDao.saveAddress(obj);
    }

    //删除
    public int deleteAddressById(Integer id) {
        return addressDao.deleteAddressById(id);
    }

    //修改
    public int updateAddressById(Address obj) {
        return addressDao.updateAddressById(obj);
    }
}
